package com.supor.aiot.websocket;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

/**
 * ---------------------------------------------------------------- <br>
 * Copyright (C) 2014-2021, by het, ShenZhen, All rights reserved.  <br>
 * ---------------------------------------------------------------- <br>
 * <p>
 * 描述: JWebSocketClient <br>
 * 作者: lei <br>
 * 日期: 2021/9/20 <br>
 */
public class JWebSocketClient extends WebSocketClient {

    public JWebSocketClient(URI serverUri) {
        super(serverUri, new Draft_6455());
    }

    @Override
    public void onOpen(ServerHandshake handshakedata) {
        Logc.i("JWebSocketClient", "onOpen()");
    }

    @Override
    public void onMessage(String message) {
        Logc.i("JWebSocketClient", "onMessage()");
    }

    @Override
    public void onClose(int code, String reason, boolean remote) {
        Logc.i("JWebSocketClient", "onClose()");
    }

    @Override
    public void onError(Exception ex) {
        Logc.i("JWebSocketClient", "onError()");
    }
}
